package org.xilin

class Teacher {
    String      firstName
    String      lastName
    String      type
    User        user
    User        updatedBy
    Course      course
    Semester    semester
    Date        dateCreated, lastUpdated

    static belongsTo = [user:User]
    
    static constraints = {
        firstName   (blank:false)
        lastName    (blank:false)
        user        (nullable:true)
        type        (nullable:true)
        course      (nullable:true)
        semester    (nullable:true)
        updatedBy   (nullable:true)
    }

    static mapping = {
        version false
        cache true
    }

    String toString() {
        firstName + " " + lastName
    }

}
